package com.example.designpatterns.model.observer.demo;

/**
 * @author yanyun zhu
 * @version 1.0
 * @date 2022/1/4 9:42
 */
public class RegPromotionObserver implements  RegObserver{

    private PromotionService promotionService; // 依赖注入

    @Override
    public void handleRegSuccess(Long userId) {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                promotionService.issueNewUserExperienceCash(userId);
            }
        });
        thread.start();
    }
}
